package dao;

import java.sql.ResultSet;
import java.sql.SQLException;

public class TokenDao
{

  
  //根据tokenId查询用户ID
  public String findUserIdByToken(String token)
  {
    String userId = null;
    try {
    	PooledConn pooledConn = new PooledConn();
      String sql = "select * from a_user where tokenId = '" + token + "'";
      ResultSet rs = pooledConn.getInstance().executeQuery(sql);
      while (rs.next()) {
    	  userId = rs.getString("id");
      }
    } catch (SQLException e) {
      e.printStackTrace();
    }
    finally
    {
//    	PooledConn.getInstance().close();
    }
    return userId;
  }

}